package org.jeecg.modules.config;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.result.Result;
import org.jeecg.common.util.result.ResultMapper;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author guoyh
 * @ClassName ExceptionHandle
 * @Description
 * @since 2020/8/11 23:17
 **/
@RestControllerAdvice
@Slf4j
public class ExceptionHandle {


    @ExceptionHandler(value = RuntimeException.class)
    public Result runtimeExceptionHandle(RuntimeException ex) {
        log.error("RuntimeException", ex);
        return ResultMapper.error();
    }

}
